import request from '@/utils/request'

export function getCompanyInfo(id) {
  return request({
    url: '/company/' + id,
    method: 'get'
  })
}

export function getRoleList(params) {
  return request({
    url: '/sys/role',
    method: 'get',
    params
  })
}
// 添加数据
export function addRole(data) {
  return request({
    url: '/sys/role',
    method: 'post',
    data
  })
}
// 回显数据
export function getRoleDetail(id) {
  return request({
    url: `/sys/role/${id}`,
    method: 'get'
  })
}
// 更新数据
export function updateRole(data) {
  return request({
    url: `/sys/role/${data.id}`,
    method: 'put',
    data
  })
}
// 删除数据
export function delRole(id) {
  return request({
    url: `/sys/role/${id}`,
    method: 'delete'
  })
}

export function assignPerm(data) {
  return request({
    url: `/sys/role/assignPrem`,
    method: 'put',
    data
  })
}
